<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // let num1 = prompt('输入数字')
        // num = num1 < 10 ? '0' + num1 : num1
        // alert(num)

        let num1 = +prompt('输入第一个数'), num2 = +prompt('输入第二个数'), num3 = prompt('输入符号');
        switch (num3) {
            case '+':
                num = num1 + num2
                break;
            case '-':
                num = num1 - num2
                break;
            case '*':
                num = num1 * num2
                break;
            case '/':
                num = num1 / num2
                break;
            default:
                num = '找不到对应的符号'
                break;
        }
        alert('结果为:' + num);

    </script>
</body>

</html>